package com.java.exer_2;

import java.util.Calendar;

/**
 * @author luzhikun
 * @date 2020/12/15-21:33
 */
public class Test {
    public static void main(String[] args) {
//        Scanner sc=new Scanner(System.in);
//        System.out.println("请输入本月月份");
//        int c= sc.nextInt();

        Calendar calendar = Calendar.getInstance();
        int month = calendar.get(Calendar.MONTH);

        Employee[] a = new Employee[2];
        a[0] = new SalariedEmployee("鲁志坤",
                1001, new MyDate(1998, 8, 2), 50000);
        a[1] = new hourlyEmpoyee("吴杰", 1002, new MyDate(1997, 12, 2), 50, 240);

        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
            double b = a[i].earnings();
            System.out.println(" 工资为:" + b);
            if (month + 1 == a[i].getBirthday().getMouth()) {
                System.out.println("生日快乐,工资涨一百");
            }
        }

    }
}